import sys  
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QMessageBox  

# 创建主窗口类  
class MainWindow(QMainWindow):  
    def __init__(self):  
        super().__init__()  
        self.setWindowTitle("简易PySide6程序")  
        self.setGeometry(100, 100, 400, 300)  

        # 添加按钮  
        self.button = QPushButton("点击我", self)  
        self.button.setGeometry(150, 130, 100, 40)  
        self.button.clicked.connect(self.show_message)  

    def show_message(self):  
        QMessageBox.information(self, "提示", "你点击了按钮！")  

# 运行应用  
app = QApplication(sys.argv)  
window = MainWindow()  
window.show()  
sys.exit(app.exec())  

# test_pyqt